import { runInAction, makeAutoObservable } from 'mobx';
class Demo2 {
    constructor() {
        this.count = 1;
        makeAutoObservable(this);
    }
    addCount = () => {
        this.count += 1;
    };
    asyncAddCount = () => {
        console.log(this);
        setTimeout(() => {
            runInAction(() => { // 异步内需要
                this.count += 10;
            });
        }, 2000);
    };
};

export default new Demo2();
